import './i18n'
import { Suspense } from 'react'
import { createRoot } from 'react-dom/client'
import './index.css'
import App from './App.tsx'
import { ThemeProvider } from './utils/ThemeContext'
import { Spin } from 'antd'
import { Provider } from 'react-redux'
import { store, persistor } from './store'
import { PersistGate } from 'redux-persist/integration/react'

createRoot(document.getElementById('root')!).render(
  <Provider store={store}>
    <PersistGate loading={<Spin fullscreen />} persistor={persistor}>
      <Suspense fallback={<Spin fullscreen />}>
        <ThemeProvider>
          <App />
        </ThemeProvider>
      </Suspense>
    </PersistGate>
  </Provider>,
)
